import Vue from 'vue'
import Vuex from 'vuex'

import mutations from "./mutations"
import actions from "./actions"
import getters from "./getters"

import moduleA from "./modules/moduleA";


//1.安装插件
Vue.use(Vuex)

//2.创建Vuex对象
const state = {
  counter: 1000,
  students: [
    {id: 110, name: '杨美霞', age: 19},
    {id: 111, name: '李宇超', age: 20},
    {id: 112, name: '杨杨美美霞霞', age: 21},
    {id: 113, name: '美美霞霞杨杨', age: 22},
  ],
  info: {
    name: '杨美霞',
    age: 23,
    height: 1.61
  }
}

const store = new Vuex.Store({
  state,
  mutations,
  actions,
  getters,
  modules: {
    a: moduleA
  }
})

//3.到处store
export default store
